//
//  MAMapCell.m
//  YunGui
//
//  Created by HanenDev on 16/4/13.
//  Copyright © 2016年 hanen. All rights reserved.
//

#import "MAMapCell.h"
#import "Macro.h"

#define CELLH 65
@implementation MAMapCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat startx = [UIView getWidth:10];
        CGFloat labW = 70;
        
        
        UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(startx, 5, kScreenWidth - 2*startx, CELLH - 5)];
        bgView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:bgView];
        
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, bgView.width-2*10, 20)];
        _nameLabel.textColor = UIColorFromRGB(0x474747);
        _nameLabel.font = [UIFont systemFontOfSize:16.0f];
        [bgView addSubview:_nameLabel];
        
        _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(8, _nameLabel.maxY, labW, 20)];
        _timeLabel.textColor = UIColorFromRGB(0xa1a2a7);
        _timeLabel.font = [UIFont systemFontOfSize:14.0f];
        _timeLabel.textAlignment = NSTextAlignmentCenter;
        [bgView addSubview:_timeLabel];
        
        UIView *line1 = [[UIView alloc]initWithFrame:CGRectMake(_timeLabel.maxX + 2.5, _nameLabel.maxY, 1, 20)];
        line1.backgroundColor = GrayVerLineColor;
        [bgView addSubview:line1];
        
        _distanceLabel = [[UILabel alloc]initWithFrame:CGRectMake(_timeLabel.maxX +5, _nameLabel.maxY, labW, 20)];
        _distanceLabel.textColor = UIColorFromRGB(0xa1a2a7);
        _distanceLabel.font = [UIFont systemFontOfSize:14.0f];
        _distanceLabel.textAlignment = NSTextAlignmentCenter;
        [bgView addSubview:_distanceLabel];
        
        UIView *line2 = [[UIView alloc]initWithFrame:CGRectMake(_distanceLabel.maxX + 2.5, _nameLabel.maxY, 1, 20)];
        line2.backgroundColor = GrayVerLineColor;
        [bgView addSubview:line2];
        
        _walkLabel = [[UILabel alloc]initWithFrame:CGRectMake(_distanceLabel.maxX + 5+10, _nameLabel.maxY, labW+5, 20)];
        _walkLabel.textColor = UIColorFromRGB(0xa1a2a7);
        _walkLabel.font = [UIFont systemFontOfSize:14.0f];
        _walkLabel.textAlignment = NSTextAlignmentCenter;
        [bgView addSubview:_walkLabel];
    }
    return self;
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
